<template>
  <div>
    <van-nav-bar
      title="标题"
      left-text="返回"
      left-arrow
      @click-left="onClickLeft"
      @click-right="onClickRight"
    />
    <!-- 地址 -->
    <van-address-list
      v-model="chosenAddressId"
      :list="list"
      default-tag-text="默认"
      @add="onAdd"
      @edit="onEdit"
    />
    <!-- 商品 -->
    <van-card
      num="2"
      price="2.00"
      desc="描述信息"
      title="商品标题"
      thumb="https://img01.yzcdn.cn/vant/ipad.jpeg"
    />
    <br />
    <van-field
      v-model="message"
      rows="2"
      autosize
      label="留言"
      type="textarea"
      maxlength="50"
      placeholder="请输入留言"
      show-word-limit
    />
    <van-radio-group v-model="radio">
      <van-radio name="1" checked-color="green">微信支付</van-radio>
      <br />
      <van-radio name="2" checked-color="blue">支付宝</van-radio>
    </van-radio-group>
    <van-submit-bar :price="3050" button-text="提交订单" class="" />
    <van-button @click="zhifu">去支付</van-button>
  </div>
</template>

<script>
export default {
  data() {
    return {
        zhifubao:[],
        radio:'',
        chosenAddressId: '1',
        list: [
        {
          id: '1',
          name: '张三',
          tel: '13000000000',
          address: '浙江省杭州市西湖区文三路 138 号东方通信大厦 7 楼 501 室',
          isDefault: true,
        },
      ],
    };
  },
  methods:{
    zhifu(){
      this.axios.get('/index/getpayurl?order_code=1')
      .then((resp) => {
        console.log('支付宝跳转',resp)
        this.zhifubao = resp.data.pay_url
        window.location = this.zhifubao
      }).catch((err) => {
        console.log(err)
      });
    }
  }
};
</script>

<style>
</style>